package com.lyfy.sd.order.vo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author: 谢星星
 * @date: 2022/9/11 02:17
 * @description:
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class RespVo {
    @Builder.Default
    private String msg = "OK";

    private String code;

    private Object result;

    public static RespVo SUCCESS(Object result) {
        return RespVo.builder()
                .msg("OK")
                .code("0000")
                .result(result)
                .build();
    }

    public static RespVo SUCCESS() {
        return RespVo.builder()
                .msg("OK")
                .code("0000")
                .build();
    }

    public static RespVo FAIL(Object result) {
        return RespVo.builder()
                .msg("FAIL")
                .code("911")
                .result(result)
                .build();
    }

    public static RespVo FAIL() {
        return RespVo.builder()
                .msg("FAIL")
                .code("911")
                .build();
    }

}
